package com.book.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.book.item.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from user where user.userName=#{username}")
    @Results({
            @Result(id=true,property = "id",column = "id"),
            @Result(property ="roles",column = "id",javaType = List.class,many = @Many(select ="com.book.item.mapper.RoleMapper.findById"))
    })
    User findByUserid(String username);
}
